package com.supermarket.constant;

public class RedisConstant {

    // 用户登录验证码相关的常量
    public  static  final String LOGIN_VALIDATE_CODE_PREFIX = "user:login:validatecode:";
    // 用户登录 token 相关的常量
    public static final String LOGIN_TOKEN_PREFIX = "user:login:";
    // Redis缓存key前缀
    public static final String CACHE_DASHBOARD_KEY = "dashboard:";
    public static final String CACHE_TODAY_ORDER_COUNT = CACHE_DASHBOARD_KEY + "today_order_count";
    public static final String CACHE_TODAY_SALES = CACHE_DASHBOARD_KEY + "today_sales";
    public static final String CACHE_TOTAL_USER = CACHE_DASHBOARD_KEY + "total_user";
    public static final String CACHE_TOTAL_PRODUCT = CACHE_DASHBOARD_KEY + "total_product";
    public static final String CACHE_LAST_7DAYS_SALES = CACHE_DASHBOARD_KEY + "last_7days_sales";
    public static final String CACHE_CATEGORY_PRODUCT = CACHE_DASHBOARD_KEY + "category_product";
    public static final String CACHE_TOP_SELLING = CACHE_DASHBOARD_KEY + "top_selling";



    // 用户缓存key
    public static final String CACHE_USER_KEY = "user:";
    public static final String CACHE_USER_INFO = CACHE_USER_KEY + "info:";  // 后面加用户ID
    public static final String CACHE_USER_LIST = CACHE_USER_KEY + "list";
    public static final String CACHE_USER_PAGE = CACHE_USER_KEY + "page:";  // 后面加页码和大小

    // 商品缓存key
    public static final String CACHE_PRODUCT_KEY = "product:";
    public static final String CACHE_PRODUCT_INFO = CACHE_PRODUCT_KEY + "info:";  // 后��加商品ID
    public static final String CACHE_PRODUCT_LIST = CACHE_PRODUCT_KEY + "list";
    public static final String CACHE_PRODUCT_PAGE = CACHE_PRODUCT_KEY + "page:";  // 后面加页码和大小
    public static final String CACHE_PRODUCT_CATEGORY = CACHE_PRODUCT_KEY + "category:";  // 后面加分类ID

    // 分类缓存key
    public static final String CACHE_CATEGORY_KEY = "category:";
    public static final String CACHE_CATEGORY_INFO = CACHE_CATEGORY_KEY + "info:";  // 后面加分类ID
    public static final String CACHE_CATEGORY_LIST = CACHE_CATEGORY_KEY + "list";
    public static final String CACHE_CATEGORY_ALL = CACHE_CATEGORY_KEY + "all";
    public static final String CACHE_CATEGORY_PAGE = CACHE_CATEGORY_KEY + "page:";
    // 订单缓存key
    public static final String CACHE_ORDER_KEY = "order:";
    public static final String CACHE_ORDER_INFO = CACHE_ORDER_KEY + "info:";  // 后面加订单ID
    public static final String CACHE_ORDER_USER = CACHE_ORDER_KEY + "user:";  // 后面加用户ID
    public static final String CACHE_ORDER_PAGE = CACHE_ORDER_KEY + "page:";  // 后面加页码和大小

    // 库存缓存key
    public static final String CACHE_STOCK_KEY = "stock:";
    public static final String CACHE_STOCK_INFO = CACHE_STOCK_KEY + "info:";  // 后面加商品ID
    public static final String CACHE_STOCK_LIST = CACHE_STOCK_KEY + "list";
    public static final String CACHE_STOCK_LOCK = CACHE_STOCK_KEY + "lock:";  // 后面加商品ID

    // 缓存过期时间（分钟）
    public static final long CACHE_EXPIRE_TIME_5 = 5;  // 5分钟
    public static final long CACHE_EXPIRE_TIME_30 = 30;  // 30分钟
    public static final long CACHE_EXPIRE_TIME_60 = 60;  // 1小时
    public static final long CACHE_EXPIRE_TIME_720 = 720;  // 12小时
    public static final long CACHE_EXPIRE_TIME_1440 = 1440;  // 24小时
}
